/* 获取用户信息 */
import httpInstance from '@/utils/http'
/* 引入类型校验  */
import type {
  loginTypes,
  loginRespondReturn,
  userInfoRespondData,
} from './userType'
/* 统一管理项目用户相关接口地址 */
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}
/* 登录接口 */
export const loginAPI = (data: loginTypes) =>
  httpInstance.post<any, loginRespondReturn>(API.LOGIN_URL, data)
/* 获取用户信息 */
export const getUserInfoAPI = () =>
  httpInstance.get<any, userInfoRespondData>(API.USERINFO_URL)
/* 退出登录 */
export const logOut = () => httpInstance.post<any, any>(API.LOGOUT_URL)
